
const path = require('path');
const webpack = require('webpack');

const ErrorPlugin = require('./ErrorPlugin');

module.exports = {
    mode: 'development',
    entry: {
        'umi-app': './src/abc.js',
        'umi-2app': './src/ddd2.js',
        test: './src/test.js', // 注释掉这一行 问题解决了.
    },
    output: {
        filename: '[name].js',
        path: path.resolve(__dirname, 'dist'),
    },
    plugins: [ 
        // new webpack.container.ModuleFederationPlugin({ filename: 'remoteEntry.js', name: 'umi-app', exposes: { './test': './src/test.js' } }),
        new ErrorPlugin(),
    ],
    module: {
        rules: [
            {
                test: /\.m?js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        "plugins": [
                            [
                                "module-resolver",
                                {
                                    root: ['./'],
                                    alias: {
                                      '@': './src',
                                    },
                                  },
                            ],
                            [
                                "module-resolver",
                                {
                                    root: ['./'],
                                    alias: {
                                      '@': './src',
                                    },
                                  },

                            ],
                        ]
                    }
                }
            }
        ]
    }
}